<template>
  <h2>App父级组件：suspense组件的使用</h2>
  <Suspense>
    <template #default>
      <!-- <async-component/> -->
      <AsyncAddress/>
    </template>
    <template v-slot:fallback>
      <h3>loading</h3>
    </template>
  </Suspense>

</template>
<script lang="ts">
import { defineComponent } from 'vue'
// import AsyncComponent from './AsyncComponent.vue'
// vue2中的动态引入组件的写法，vue3不行
// const AsyncComponent = () => import('./AsyncComponent.vue')
// vue3中的写法
// const AsyncComponent = defineAsyncComponent(() => import('./AsyncComponent.vue'))
import AsyncAddress from './AsyncAddress.vue'
export default defineComponent({
  components: { AsyncAddress },
  name: 'App',
  setup () {
    return {
    }
  }
})
</script>
